package com.ali.juejin.base

import android.os.Bundle
import android.os.PersistableBundle
import androidx.appcompat.app.AppCompatActivity

abstract class BaseActivity: AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(getLayoutId())
        initView()
        initData()
    }


    abstract fun getLayoutId():Int

    open protected fun initView(){

    }

    open protected fun initData(){

    }

    // 返回上一个activity
    protected fun onBack(){
        finish()
    }
}